package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Dialog{
    private String dialogName;
    private TextView tvMsg;
    private Button btnOk;
    private Button btnCancel;
    public MainActivity(Context context, String dialogName){
        super(context);
        this.dialogName=dialogName;
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tvMsg=(TextView)findViewById(R.id.tv_msg);
        btnOk=(Button)findViewById(R.id.btn_ok);
        btnCancel=(Button)findViewById(R.id.btn_cancel);
        tvMsg.setText(dialogName);
        btnOk.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        btnCancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }
}
